package com.conceal.client.utils;

import java.io.IOException;
import java.util.Date;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

public class DateSerializerProvider extends JsonSerializer<Date> {

	@Override
	public void serialize(Date value, JsonGenerator jgen, SerializerProvider sp)
			throws IOException, JsonProcessingException {
		// 将日期用毫秒数的字符串表示，可以避免日期格式问题
		jgen.writeNumber(value.getTime());
	}


}
